<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <script type="text/javascript">
        function test(data,title,url){
            console.log('data:'+ data + 'title:' + title + 'url:' +url);
        }

        function onMessage(event){
            var data = event.data;
            test.apply(window,data);

        }
        debugger;
        onMessage({
            data:[{
                from:'1',
                to:'2'
            },'title','page1']
        });

    </script>
</head>
<body>

</body>
</html>